# Variables
SRC_DIR = src
BIN_DIR = bin
CLASSES = $(wildcard $(SRC_DIR)/*.java)
JFLAGS = -d $(BIN_DIR)

# Targets
all: setup Database1 Database2

setup:
	mkdir -p $(BIN_DIR)

compile: $(CLASSES)
	javac $(JFLAGS) $(CLASSES)

Database1: $(CLASSES)
	java -cp $(BIN_DIR) Database1

Database2: $(CLASSES)
	java -cp $(BIN_DIR) Database2

clean:
	rm -rf $(BIN_DIR)

.PHONY: all setup clean